<extend name="Public/base"/>

<block name="body">
	<div class="main-title">
		<h2>{$meta_title} [ <present name="Think.get.group">
         <a href="{:U('index')}">全部</a><else/><strong>全部</strong></present>&nbsp;<foreach name="group" item="vo">
		<neq name="group_id" value="$key">
         <a href="{:U('index?group='.$key)}">{$vo}</a><else/><strong>{$vo}</strong></neq>&nbsp;     
        </foreach> ]</h2>
	</div>

	<div class="cf">
		<a class="btn" href="{:U('edit')}">新 增</a>
		  <button class="btn ajax-post confirm" url="{:U('del')}" target-form="ids">删 除</button>
        <!--<div class="search-form fr cf">-->
            <!--<div class="sleft">-->
                <!--<input type="text" name="title" class="search-input" value="{:I('name')}" placeholder="请输入视频名称">-->
                <!--<a class="sch-btn" href="javascript:;" id="search" url="__SELF__"><i class="btn-search"></i></a>-->
            <!--</div>-->
        <!--</div>-->
	</div>

	<div class="data-table table-striped">
		<table class="">
			<thead>
			<tr>
				<th class="row-selected">
					<input class="checkbox check-all" type="checkbox">
				</th>
				<th>ID</th>
				<th class="">名称</th>
				<th class="">有效天数</th>
				<th class="">充值金额</th>
				<th class="">买</th>
				<th class="">送</th>
				<th class="">操作</th>
			</tr>
			</thead>
			<tbody>
			<notempty name="list">
			<volist name="list" id="vo">
				<tr>
					<td><input class="ids row-selected" type="checkbox" name="id[]" value="{$vo.id}"></td>
					<td class="">{$vo.id}</td>
					<td class="">{$vo.name}</td>
					<td class="">{$vo.days}天</td>
					<td class="">{$vo.amount}元</td>
					<td class="">{$vo.buy}</td>
					<td class="">{$vo.send}</td>
					<td>
						<a href="{:U('edit',array('id'=>$vo['id']))}">编辑</a>
						<a href="{:U('del',array('id'=>$vo['id']))}" class="confirm ajax-get">删除</a>
					</td>
				</tr>
			</volist>
			<else/>
			<td colspan="6" class="text-center"> aOh! 暂时还没有内容! </td>
			</notempty>
			</tbody>
		</table>
        <!-- 分页 -->
        <div class="page">
			{$_page}
        </div>
	</div>
</block>

<block name="script">
 <script type="text/javascript">
        $(function() {
            //搜索功能
            $("#search").click(function() {
                var url = $(this).attr('url');
                var query = $('.search-form').find('input').serialize();
                query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
                query = query.replace(/^&/g, '');
                if (url.indexOf('?') > 0) {
                    url += '&' + query;
                } else {
                    url += '?' + query;
                }
                window.location.href = url;
            });
        });
    </script>
</block>